<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
			"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 	xmlns="http://www.w3.org/1999/xhtml"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core">
		
<h:head>
	<title>A Simple JavaServer Faces Registration Application</title>
	<h:outputStylesheet name="resources/css/styles.css"/>
</h:head>

<h:body>
	
<ui:composition template="/lnf-template.xhtml">
<ui:define name="title">
JavaServer Faces Virtual Trainer Application
Registration </ui:define>
<ui:define name="body">

	<h:form>
		<h2>JSF Registration App</h2>
		<h4>Registration Form</h4>
		<table>
		<tr>
			<td>First Name:</td>
			<td>	<h:inputText label="First Name"
					id="fname" value="#{user.firstName}" required="true"/>
				<h:message for="fname" />
			</td>
		</tr>
		
		<tr>
			<td>Last Name:</td>
			<td>
				<h:inputText label="Last Name"
					id="lname" value="#{user.lastName}"
					required="true"/>
				<h:message for="lname" />
			</td>
		</tr>
	
		<tr>
			<td>Sex:</td>
			<td>
				<h:selectOneRadio label="Sex"
				id="sex" value="#{user.sex}"
				required="true">
				<f:selectItem itemLable="Male" itemValue="male" />
				<f:selectItem itemLable="Female" itemValue="female" />
				</h:selectOneRadio>
				<h:message for="sex" />
			</td>
		</tr>
		<tr>
			<td>Date of Birth:</td>
			<td>
				<h:inputText label="Date of Birth"
				id="dob" value="#{user.dob}" required="true">
				<f:convertDateTime pattern="MM-dd-yy" />
				</h:inputText> (mm-dd-yy)
				<h:message for="dob" />
			</td>
		</tr>
		<tr>
			<td>Email Address:</td>
			<td>	<h:inputText label="Email Address"
				id="email" value="#{user.email}"
				required="true"
				validator="#{user.validateEmail}"/>
			<h:message for="email" />
			</td>
		</tr>
		<tr>
			<td>Service Level:</td>
			<td>
			<h:selectOneMenu label="Service Level"
			value="#{user.serviceLevel}">
			<f:selectItem itemLabel="Medium" itemValue="medium" />
			<f:selectItem itemLabel="Basic" itemValue="basic" />
			<f:selectItem itemLabel="Premium" itemValue="premium" />
			</h:selectOneMenu>
			</td>
		</tr>
	</table>
	
		<p><h:messages /></p>
		<p><h:commandButton value="Register" action="confirm" /></p>
	</h:form>
		</ui:define>
	</ui:composition>
	
</h:body>
</html>